﻿using System.Collections.Generic;
using CNF.Common.Base.SimpleOrm.Entities;

namespace CNF.Common.Base.SimpleOrm.Data
{
    /// <summary>
    /// 数据查询接口
    /// </summary>
    public interface IViewDataService<DataKeyType,EntityType> 
        where DataKeyType : struct
        where EntityType : BaseEnity<DataKeyType>, new()
    {
 
        EntityType LoadByID(DataKeyType dataKey);

        List<EntityType> QueryAll();

        //List<EntityType> QueryListBySQL(string sql, params object[] args);

        //List<EntityType> QueryListBySQL(Sql sql);

        //List<EntityType> QueryListByCondition(string condition, params object[] args);

        //EntityType QuerySingleBySQL(string sql, params object[] args);

        //EntityType QuerySingleBySQL(Sql sql);

        //EntityType QuerySingleByCondition(string condition, params object[] args);

        //T ExecuteScalar<T>(string sql, params object[] args);

        //T ExecuteScalar<T>(Sql sql);

        //Page<EntityType> Page(long page, long itemsPerPage, string sql, params object[] args);

        //Page<EntityType> Page(long page, long itemsPerPage, Sql sql);
 
        //bool Exists(string sqlCondition, params object[] args);

        bool Exists(object primaryKey);
 
        bool IsNew(EntityType poco);

        

        string GetDbObjectName();

        string GetPkName();
    }
}
